home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / cad / lasi512b.zip / LASIDSS.LHI < prev    next >
Text File  |  1996-04-04  |  16KB  |  458 lines

  1. ≡≡
  2.  
  3. Introduction
  4.  
  5.  Introduction
  6.  
  7.                         LASI Data Structure Standard
  8.                         ----------------------------
  9.  
  10.   The following information is supplied for use by anyone who may want to
  11.   access the data structure of LASI drawings. LASI data files have two
  12.   representations, internal and external. The information regarding
  13.   internal data files is subject to change, and, be warned, any programs
  14.   using it may need to be modified in the future. External format will
  15.   remain consistent, or at most a conversion program will be supplied if
  16.   modifications are made.
  17.  
  18.   Internal (DBD, BP5 and CL5) data files are optimized for fast access and
  19.   are used by the program itself as it executes.
  20.  
  21.   Utilities may be written to operate on these files, but it may be
  22.   somewhat more difficult due to the cell pointers used internally.
  23.  
  24.   External (TLC) files are ASCII files that contain cell references by name
  25.   not pointer and data for objects in readable (and editable) ASCII.
  26.   Transfer of cells between drawings can be more easily accomplished and
  27.   utility programs can be more easily written when the external form is
  28.   used.
  29.  
  30. Internal Data Files
  31.  
  32.  Internal File Types
  33.  
  34.   A drawing consists of Drawing Basic Data files (.DBD extension) and a
  35.   number of cell files (.BP5 and .CL5). The DBD files are the CELLS5.DBD,
  36.   CONSTS5.DBD and FORM.DBD files. These are ASCII sequential files.
  37.   CELLS5.DBD contains the information regarding the cells associated with a
  38.   drawing. CONSTS5.DBD contains the preserved constants that set up a
  39.   drawing, i.e. window sizes, scales, etc. FORM.DBD contains permanent
  40.   setup information for a drawing.
  41.  
  42.   There is also a TFF.DBD file that is binary and contains the text font
  43.   patterns. This has to be edited using the MAKETFF.EXE program. This file
  44.   may have an arbitrary name. For more information on this file read Text
  45.   Generation in the main LASI help.
  46.  
  47.  CELLS5.DBD file
  48.  
  49.   This is an ASCII sequential file consisting of the number of cells
  50.   followed by 10-entry records for each cell.
  51.  
  52.  
  53.   File Format:
  54.  
  55.   Number of Cells<nl>
  56.  
  57.   Cell 1 Record:
  58.       Entry:
  59.           1= Name of cell<nl>
  60.           2= Rank of cell (1-15)<sp> (see below)
  61.           3= Left boundary of cell in basic units<sp>
  62.           4= Bottom boundary of cell in basic units<sp>
  63.           5= Right boundary of cell in basic units<sp>
  64.           6= Top boundary of cell in basic units<sp>
  65.           7= Number of boxes in cell<sp>
  66.           8= Number of poly in cell<sp>
  67.           9= Number of vertices in cell<sp>
  68.           10= Number of cells in cell<nl>
  69.  
  70.   Cell 2 Record: etc.,etc.,
  71.  
  72.   Notes:
  73.  
  74.     1. Cells may be in any order. A cell with rank other than 1-15 is
  75.        uneditable.
  76.  
  77.     2. Pooled cells are marked with the 16-bit (10 hex) set to 1. Since
  78.        pooled cells may have only a rank of 1, this number will always be
  79.        17 for a pooled cell.
  80.  
  81.  CONSTS5.DBD File
  82.  
  83.   The CONSTS5.DBD file is a nonessential file; if absent, it defaults to a
  84.   standard configuration when the LASI program is started. When LASI is
  85.   closed, a CONSTS5.DBD with the present configuration is written.
  86.  
  87.   It is possible for future versions of LASI to have different CONSTS5.DBD
  88.   files, that is, compatibility is not guaranteed. In such case, deleting
  89.   an old CONSTS5.DBD file and defaulting to the standard configuration at
  90.   first will be necessary.
  91.  
  92.   It is expected that the first 3 entries (the version, the scale factor,
  93.   and the physical units) will be unchanged, since they provide information
  94.   to conversion utilities.
  95.  
  96.   File Format:
  97.  
  98.   The present CONSTS5.DBD file contains the following sequential ASCII data
  99.   readable by a BASIC INPUT or a C scanf() function:
  100.  
  101.       The Version of LASI under which the file was made
  102.       The Number of Basic Units per Physical Unit
  103.       The Name of the Physical Unit
  104.  
  105.       A 64 character Color String with each character indicating the color
  106.       of the layer (r=red etc.)
  107.  
  108.       64 FILL numbers indicating which fills are to be used on the
  109.       corresponding layer.
  110.  
  111.       64 DASH numbers indicating which dashes are to be used on the
  112.       corresponding layer.
  113.  
  114.       The Number of Working Grids
  115.       The Number of Dot Grids
  116.       All 10 Working Grids in basic units
  117.       All 10 Dot Grids in basic units
  118.  
  119.       For Each of 15 Ranks:
  120.         The Default Working Grid Number
  121.         The Default Dot Grid Number
  122.         The Grid Visibility Flag
  123.         The Window Width, in basic units
  124.         The Window Center X and Y Positions, in basic units
  125.  
  126.  
  127.   32-bit Integer Constants:
  128.  
  129.       Default Path Width
  130.       Default Text Size
  131.       fill with 0 to 8 entries
  132.  
  133.   16-bit Integer Constants:
  134.  
  135.       Layer Number for ADD
  136.       Text Layer for ADD
  137.       Drawing Resolution Number
  138.       Number of Arc Segments
  139.       Double Click Ticks
  140.       Position Report Ticks
  141.       Sort Backup Time
  142.       Keyboard Toggle Flags (8)
  143.       DPTH number
  144.       fill with 0 to 16 entries
  145.  
  146.   Double Float Constants:
  147.  
  148.       The Maximum Number of Saved Windows (9)
  149.       9 Saved Window Widths, X Centers and Y Centers
  150.       Text Spacing Ratio
  151.       PSIZ Number
  152.       Rotation Angle
  153.       OVSZ Distance
  154.       R Sheet Resistance
  155.       C per Square
  156.       R End Correction
  157.       X Mickey Multiplier
  158.       Y Mickey Multiplier
  159.       fill with 0 to 16 entries
  160.  
  161.   String Constants:
  162.  
  163.       For Each of 15 Ranks:
  164.         VIEW Layers
  165.         OPEN Layers
  166.         Layer Table VIEW Mask (2x32-bits)
  167.         Layer Table OPEN Mask (2x32-bits)
  168.  
  169.       Kind of Object to be ADDed ("B","P", or Name of Cell)
  170.       Arc Add Direction (cw, ccw)
  171.       fill with "reserved" to 8 entries
  172.       "end" (marker for short file read check)
  173.  
  174.  Cell Data Files
  175.  
  176.   There are two kinds of Cell Data Files, BP5 files and CL5 files. BP5
  177.   files contain the boxes, poly and vertices of a cell. CL5 files contain
  178.   the cells within the cell. All cells have BP5 files, but only if a cell's
  179.   rank > 1 will one have a CL5  file.
  180.  
  181.   Both files are binary files. Each block of data records is read until a
  182.   zero is encountered in the first record entry. (Actually a whole zero
  183.   record is written to the files.) The box data records are placed first in
  184.   a BP5 file, followed by the path data records, and finally by the vertex
  185.   data records. This data structure allows any unknown cell file to be read
  186.   into the drawing system without prior knowledge of the number or type of
  187.   records.
  188.  
  189.   Notes:
  190.  
  191.     1. In records, separator characters will be shown in < >.
  192.        <nl>= newline (<cr><lf>)
  193.        <sp>= space
  194.  
  195.     2. Basic Units are the smallest unit of the 32-bit long integers in 
  196.        which a drawing is maintained in the LASI data. Physical Units are 
  197.        the units in which you do a layout drawing (mil, um, etc.) These 
  198.        are related to the basic units by the Scale Factor.
  199.  
  200.     3. Version numbers may contain alpha characters but the number must
  201.        always begin with a numeric character.
  202.  
  203.  Box Data Structure
  204.  
  205.   Box data is kept in an array of structures with 1 16-bit and 4 32-bit 
  206.   members.
  207.  
  208.       Box Record Entries:
  209.  
  210.       0 = Bits 0-7 , Layer Number (1-64)
  211.           Bits 8-11 , Active Side Program Flags (Cleared in File)
  212.           Bits 12-13 , Unused Flags (Cleared in File)
  213.           Bit 14, Program Out of Window Flag (Cleared in File)
  214.           Bit 15, Unused (Cleared in File)
  215.  
  216.                         active side
  217.                           | | | |
  218.                   x x x x|x x x x|x x x x|x x x x
  219.                     |             | | | | | | | |
  220.                     owb           <--- layer --->
  221.        (out of window bit)
  222.  
  223.       1= Lower Left Corner X Position in basic units (32-bit)
  224.  
  225.       2= Lower Left Corner Y Position (32-bit)
  226.  
  227.       3= Upper Right Corner X Position (32-bit)
  228.  
  229.       4= Upper Right Corner Y Position (32-bit)
  230.  
  231.  Path Data Structure
  232.  
  233.   Path data is kept in an array of structures with 1 16-bit integer, 
  234.   a 32-bit member and a 16-unsigned member. 
  235.  
  236.   A variation in the normal path data structure is used in Vers 5 to store
  237.   path entities that expand as written text. The path record contains a
  238.   marker bit and orientation bits. The first vertex record is a normal
  239.   vertex record which locates the text in the drawing, however, the
  240.   subsequent records contain ASCII character codes as explained below.
  241.  
  242.   Path Record Entries:
  243.  
  244.       0 = Bits 0-7, Layer of Path (1-64)
  245.           Bit 8, Path has 1 or more Active Vertices Flag (Cleared in
  246.           File)
  247.  
  248.           Bits 9-15,
  249.  
  250.           If Normal Path:
  251.               Program Flags (Cleared in File)
  252.  
  253.           else if Path Text:
  254.               Bits 9-11, Orientation Bits (same as Cells)
  255.               Bit 15 set indicates Path Text Record
  256.  
  257.                      0x3800     0x100
  258.                       oren     active
  259.                       | | |     |
  260.                   x x x x|x x x x|x x x x|x x x x
  261.                   | |       | |   | | | | | | | |
  262.                   | owb     nop   <--- layer --->
  263.                   text                0xFF
  264.  
  265.       1= If Normal Path:
  266.           Width of Path in basic units (0 indicates Poly) (32-bit)
  267.  
  268.       else if Path Text:
  269.           Size of Path Text (size of character field)
  270.  
  271.       2= Pointer to First Vertex of path in vertex array  (16-bit)
  272.  
  273.  Vertex Data Structure
  274.  
  275.   Vertex data is kept in a array of structures with 1 16-bit integer, 2 32-bit 
  276.   integers and 1 16-bit unsigned members.
  277.  
  278.   Vertex Record Entries:
  279.  
  280.       0 = Bits 0-12, Number of Path to which Vertex belongs
  281.           Bit 13, Active Vertex Bit (Cleared in File)
  282.           Bits 14-15,
  283.  
  284.           If Normal Paths:
  285.               Program Flags (Cleared in File)
  286.  
  287.           else if Path Text:
  288.               Bit 15 set indicates Path Text Character Record
  289.  
  290.  
  291.                  0x4000
  292.                  active
  293.                     |
  294.                   x x x x|x x x x|x x x x|x x x x
  295.                   |   | | | | | | | | | | | | | |
  296.                   |    <----- path number ----->
  297.                   text vtx       0x3FFF
  298.                   0x8000
  299.  
  300.       1= If Normal Path:
  301.           X Position of Vertex in basic units (32-bits)
  302.  
  303.       else if Path Text:
  304.           4 bytes ASCII Character Code
  305.  
  306.       2= If Normal Path:
  307.           Y Position of Vertex in basic units (32-bits)
  308.  
  309.       else if Path Text:
  310.           4 bytes ASCII Character Code
  311.  
  312.       3= Pointer to next Vertex in Vertex Array (16-bit)
  313.           (Zero for the Last Vertex of a Path)
  314.  
  315.  Cell Data Structure
  316.  
  317.   Cell data is kept in a 2-dimensional array of structures of 1 16-bit 
  318.   integer and 2 32-bit integer members. The 2nd dimension is the depth of 
  319.   cell nesting, so that a parent cell remans loaded while lesser cells are 
  320.   loaded and drawn. In a CL5 file the nesting level is unnecessary, and the 
  321.   data is kept in a binary file following the same rules as the BP5 file but 
  322.   with the .CL5 file extension.
  323.  
  324.   Cell Record Entries:
  325.  
  326.       0 = Bits 0-9, Number of cell in CELLS5.DBD list
  327.           Bit 10, Active Cell Flag (Cleared in File)
  328.           Bits 11-13, Orientation (See Below)
  329.           Bit 14, Draw Outline Flag
  330.           Bit 15, Extended Flag (reserved for cell arrays)
  331.  
  332.                  outl orien active
  333.                     | | | | |
  334.                   x x x x|x x x x|x x x x|x x x x
  335.                   |           | | | | | | | | | |
  336.                   |           <--- ref number -->
  337.                   |
  338.           (reserved for cell array extended record)
  339.  
  340.       1= X Position of Cell in basic units (32-bits)
  341.  
  342.       2= Y Position of Cell in basic units (32-bits)
  343.  
  344.       Orientation:
  345.           Bit 13, Cell is flipped in Y and then rotated
  346.           Bits 12 and 11,
  347.           0= no rotation
  348.           1= 90 deg ccw rotation
  349.           2= 180 deg ccw rotation
  350.           3= 270 deg ccw rotation
  351.  
  352. External Data Files
  353.  
  354.  Transportable Cells
  355.  
  356.   The external data file representation condenses the CELLS5.DBD, BP5 and
  357.   CL5 files into one representation, thus making cells transportable. The
  358.   files have the extension .TLC (Transportable LASI Cell). TLC files can be
  359.   easily read by BASIC, PASCAL, or C.
  360.  
  361.   Each Cell has its own TLC file. This means that a TLC file may not really
  362.   contain all the information to construct a cell if it has lesser cells
  363.   within it. In that case, the TLC files for the lesser cells will have to
  364.   be present for conversion to internal form. When converting to external
  365.   form, the program TLCOUT.EXE automatically makes the TLC files for lesser
  366.   cells if they are not present in the directory. When conversion from 
  367.   external to internal is being done, the lesser cells are also made in 
  368.   internal form by the TLCIN.EXE conversion program if not already present.
  369.  
  370.  
  371.   Important:  RECORDS may be in ANY ORDER in a TLC file.
  372.  
  373.  Records in Detail
  374.  
  375.   Header Record:      <nl>= carriage return + linefeed    <sp>= space
  376.  
  377.       1= "=H" (literal)<nl>
  378.       2= Name of Cell (DOS file name)<nl>
  379.       3= Version of LASI (literal)<nl>
  380.       4= Version of TLC (literal)<nl>
  381.       5= Basic Units per Physical Unit<nl>
  382.       6= Name of Physical Unit (literal)<nl>
  383.       7= Date of Cell Conversion (literal)<nl>
  384.       8= Time of Cell Conversion (literal)<nl>
  385.       9= Rank of Cell<sp>
  386.       10= Left Outline Boundary in basic units<sp>
  387.       11= Bottom Boundary in basic units<sp>
  388.       12= Right Boundary in basic units<sp>
  389.       13= Top Boundary in basic units<nl>
  390.       14= Number of Boxes<sp>
  391.       15= Number of Paths<sp>
  392.       16= Number of Vertices<sp>
  393.       17= Number of Cells<nl>
  394.  
  395.       Note:  Versions must begin with a numeric character
  396.  
  397.   Cell Record Entries:
  398.  
  399.       1= "=C" (literal)<nl>
  400.       2= Name of Lesser Cell<nl>
  401.       3= Orientation (see below)<sp>
  402.       4= X Position in basic units<sp>
  403.       5= Y Position in basic units<sp>
  404.       6= reserved (presently zero)<nl>
  405.  
  406.       Property Number: (0-15)
  407.         16 bit integer, all bits 0 except:
  408.  
  409.           Bit 4,
  410.             0= draw cell fully
  411.             1= draw cell outline
  412.  
  413.         Orientation:
  414.           Bit 3,
  415.             0= cell not flipped
  416.             1= cell is flipped in Y before rotation
  417.  
  418.           Bits 2 and 1,
  419.             0,0 = no rotation
  420.             0,1 = 90 deg rotation CCW
  421.             1,0 = 180 deg rotation CCW
  422.             1,1 = 270 deg rotation CCW
  423.  
  424.   Box Record Entries:
  425.  
  426.       1= "=B" (literal)<nl>
  427.       2= Layer of Box<sp>
  428.       3= X of Lower Left Corner in basic units<sp>
  429.       4= Y of Lower Left Corner in basic units<sp>
  430.       5= X of Upper Right Corner in basic units<sp>
  431.       6= Y of Upper Right Corner in basic units<nl>
  432.  
  433.   Path/Poly Record Entries:
  434.  
  435.       1= "=P" (literal)<nl>
  436.       2= Layer of Path/Poly<sp>
  437.       3= Width in basic units<sp>
  438.       4= No. of Vertices in path/poly<nl>
  439.       5= Vertices in basic units in the form:
  440.       X1<sp>Y1<sp>X2<sp>Y2<sp>X3<sp>Y3<sp>X4<sp>Y4<sp>X5<sp>Y5<nl>
  441.       .......Xn-1<sp>Yn-1<sp>Xn<sp>Yn<nl>
  442.  
  443.       (Groups of 5 coordinates separated by <sp> ended by <nl>,
  444.       always with <nl> after Last Coordinate Pair)
  445.  
  446.   Text Record Entries:
  447.  
  448.       1= "=T" (literal)<nl>
  449.       2= Layer of Text<sp>
  450.       3= Size in basic units<sp>
  451.       4= No. of Vertices used by text (includes Ref Point)<sp>
  452.       5= Orientation 0-7 (same as cells)<nl>
  453.       6= X Ref Point in basic units<sp>
  454.       7= Y Ref Point in basic units<nl>
  455.       8= ASCII character text string<nl> (u/l case, up to 40 characters)
  456.  
  457.  
  458.